<template>
    <div>
        <van-share-sheet class="isWorkWX" v-model="ShowShate" title="" @select="ShareSelect"
            :options="option"></van-share-sheet>
        <van-overlay :show="showActivity" @click="showActivity = false" class-name="WXShareClass">
            <div class="inner-mask">
                <img class="img1" src="../assets/img/icony5.png" />
                <img class="img2" src="../assets/img/icony6.png" />
                <img class="img3" src="../assets/img/icony7.png" />
            </div>
        </van-overlay>
    </div>
</template>

<script>
const userAgent = window.navigator.userAgent.toLowerCase();
const isWX = userAgent.indexOf('micromessenger') !== -1;
const isWorkWX = userAgent.indexOf('wxwork') !== -1;
const isMiniProgram = isWeiChat && window.__wxjs_environment === 'miniprogram';
const isAndroid = userAgent.indexOf('android') > -1 || userAgent.indexOf("adr") > -1;
const isIOS = !!userAgent.match(/(iphone|ipod|ipad);?/);

import { wx_Cloud } from '@/utils/index.js'

export default {
    props: ['ShareData'],
    data() {
        return {
            ShowShate: false,
            showActivity: false,
            option: [
                { name: '微信好友', icon: require('@/assets/img/share-wechart.png') },
                { name: '微信朋友圈', icon: require('@/assets/img/share-wechart.png') },
                { name: '企微转发', icon: require('@/assets/img/share-wechart.png') },
                { name: '企微朋友圈', icon: require('@/assets/img/share-wechart.png') },
                { name: '用群发助手发动给客户', icon: require('@/assets/img/share-wechart.png') },
                { name: '发送到我得客户群', icon: require('@/assets/img/share-wechart.png') },
            ],
        };
    },
    methods: {
        async ShowShareEvent() {
            if (isMiniProgram) {
                return
            } else if (isAndroid && !isWX && window?.phoneContact?.shateInterface) {
                window.phoneContact.shateInterface(JSON.stringify(this.GetPhoneParmas()))
            } else if (isIOS && !isWX && window?.webkit?.messageHandlers?.shateInterface?.postMessage) {
                window.webkit.messageHandlers.shateInterface.postMessage(JSON.stringify(this.GetPhoneParmas()))
            } else if (isWorkWX) {
                this.ShowShate = true;
            } else if (isWX) {
                let data = {
                    
                }
            } else {
                return
            }
        },

    },
};
</script>

<style lang="less" scoped></style>